/**
 * 
 */
package uk.ac.ebi.curtain.utils.file.fasta;

import java.io.PrintWriter;

import org.apache.commons.lang.StringUtils;

import uk.ac.ebi.curtain.utils.file.EntryMapperBean;
import uk.ac.ebi.curtain.utils.file.impl.AbstractWriter;

/**
 * @author mhaimel
 *
 */
public class FastaWriteUtil extends AbstractWriter {
	

	@Override
	public void write(PrintWriter out, EntryMapperBean bean){
		out.print('>');
		out.print(bean.getId());
		if(StringUtils.isNotBlank(bean.getHeader())){
			out.print(' ');
			out.print(bean.getHeader());
		}
		out.println();
		for(String s : splitSequence(bean.getSequence())){
			out.println(s);
		}
	}
	
}
